import 'package:flutter/cupertino.dart';
import 'package:get/get.dart';

import 'state.dart';

class VideodetailLogic extends SuperController{
  final VideodetailState state = VideodetailState();

  loadUrl(){
    state.player.setDataSource(state.url,autoPlay: true);
    update();
  }


  @override
  void onClose() {
    super.onClose();
    state.player.release();
  }



  @override
  // TODO: implement onDelete
  InternalFinalCallback<void> get onDelete => super.onDelete;

  @override
  void onDetached() {
    print('-------onDetached');
  }

  @override
  void onInactive() {
    print('-------onInactive');
  }

  @override
  void onPaused() {
    print('-------onPaused');
    state.player.pause();
  }

  @override
  void onResumed() {
    print('-------onResumed');
    state.player.start();
    // TODO: implement onResumed
  }
}
